﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace WindowsFormsApplication1
{
    public partial class Form1 : Form
    {
        /*  private TrackBar trackBar1;
          private PictureBox pictureBox1;
          private Timer timer1;
          private System.ComponentModel.IContainer components;
          private Button button1;*/

        public Form1()
        {
            InitializeComponent();
            this.Paint += new PaintEventHandler(Form1_Paint);
            this.DoubleBuffered = true;
        }

        private void button1_Click(object sender, EventArgs e)
        {
            timer1.Enabled = true;

            /*Graphics g = Graphics.FromImage(pictureBox1.Image);
            SolidBrush b = new SolidBrush(Color.FromArgb(200, 255, 0, 0));
            g.FillEllipse(b, 10, 10, 100, 100);

            pictureBox1.Refresh();*/
        }

        private void Form1_Paint(object sender, PaintEventArgs e)
        {
            int zoom = trackBar1.Value;
            Graphics g = e.Graphics;
            int left = 270;
            int top = 110;

            /*  g.FillRectangle(Brushes.Brown, left + 30 * zoom / 100, top + 190 * zoom / 100, 40 * zoom / 100, 150 * zoom / 100);
              g.FillEllipse(Brushes.Green, left, top, 100 * zoom / 100, 200 * zoom / 100);*/
            Pen brownPen = new Pen(Color.Brown, 9);
            Pen brownRed = new Pen(Color.Red, 3);
            Pen brownPen2 = new Pen(Color.DarkOrange, 1);
            Pen yellowPen = new Pen(Color.Yellow, 3);
          //  g.FillEllipse(Brushes.Orange, 300, 60 * zoom / 100, 30 * zoom / 100, 70 * zoom / 100);
            g.FillEllipse(Brushes.Orange, 300, 260 * zoom / 100, 50 * zoom / 100, 90 * zoom / 100);
            g.FillEllipse(Brushes.Yellow, 300, 215 * zoom / 100, 50 * zoom / 100, 50 * zoom / 100);
           // g.FillEllipse(Brushes.Cornsilk, 263, 55, 40, 40); 
           // g.DrawEllipse(Brushes.AliceBlue, 263, 55, 40, 40);
          //  g.DrawEllipse(brownPen2, 263, 55, 40, 40);

            g.FillEllipse(Brushes.Cornsilk, 263, 255 * zoom / 100, 40 * zoom / 100, 40 * zoom / 100);
            g.FillEllipse(Brushes.Cornsilk, 327, 255 * zoom / 100, 45 * zoom / 100, 40 * zoom / 100);
            g.FillEllipse(Brushes.Cornsilk, 327, 292 * zoom / 100, 45 * zoom / 100, 45 * zoom / 100);
            g.FillEllipse(Brushes.Cornsilk, 263, 295 * zoom / 100, 40 * zoom / 100, 40 * zoom / 100);

            g.DrawLine(yellowPen, 300, 15, 310, 45);
            g.DrawLine(yellowPen, 320, 45, 330, 15);

            Point p1 = new Point(305, 70);
            Point p2 = new Point(312, 75);
            Point p3 = new Point(319, 75);
            Point p4 = new Point(326, 70);

            Point p11 = new Point(301, 90);
            Point p22 = new Point(312, 95);
            Point p33 = new Point(319, 95);
            Point p44 = new Point(329, 90);

            Point p111 = new Point(303, 110);
            Point p222 = new Point(312, 115);
            Point p333 = new Point(319, 115);
            Point p444 = new Point(328, 110);

            g.FillEllipse(Brushes.Blue, 307, 45, 5, 5);
            g.FillEllipse(Brushes.Blue, 318, 45, 5, 5);

            Point p1111 = new Point(308, 55);
            Point p2222 = new Point(315, 58);
            Point p3333 = new Point(318, 58);
            Point p4444 = new Point(323, 55);


            Point[] points = { p1, p2, p3, p4 };
            g.DrawCurve(brownPen, points);
            Point[] points2 = { p11, p22, p33, p44 };
            g.DrawCurve(brownPen, points2);
            Point[] points3 = { p111, p222, p333, p444 };
            g.DrawCurve(brownPen, points3);
            Point[] points4 = { p1111, p2222, p3333, p4444 };
            g.DrawCurve(brownRed, points4);

        }

        private void trackBar1_Scroll(object sender, EventArgs e)
        {
            this.Invalidate();
        }

        private void timer1_Tick(object sender, EventArgs e)
        {

            this.trackBar1.Maximum = 100;
            this.trackBar1.Minimum = 10;
            this.trackBar1.Name = "trackBar1";
            this.trackBar1.Size = new System.Drawing.Size(300, 45);
            this.trackBar1.TabIndex = 10;
            this.trackBar1.Scroll += new System.EventHandler(this.trackBar1_Scroll);
            if (trackBar1.Value < 100)
            {
                trackBar1.Value++;
            }
            Invalidate();
        }

        private void Form1_Load(object sender, EventArgs e)
        {

        }
    }
}
